import  CombinationList from "@/view/commodityCenter/combinationList";
import CommodityList from "@/view/commodityCenter/commodityList";
import CommodityManagement from "@/view/commodityCenter/commodityManagement";
import StockList from "@/view/commodityCenter/stockList";
import Login from "@/view/login";
import AppLayout from "@/view/layout";
import NotFound from "@/view/NoFound";
import Dashbord from "@/view/dashbord";
import CustomerCertification from "@/view/customerManagement/customerCertification";
import DistributorList from "@/view/customerManagement/distributorList";
import TerminalList from "@/view/customerManagement/terminalList";
import AccessManagement from "@/view/InventoryManagement/accessManagement";
import WarehouseManagement from "@/view/InventoryManagement/warehouseManagement";
import DistriminaOrderList from "@/view/orderManagement/distriminaOrderList";
import TerminalOrderList from "@/view/orderManagement/terminalOrderList";
import CustomerPrice from "@/view/priceManagement/customerPrice";
import OriginPrice from "@/view/priceManagement/originPrice";
import SalePolicy from "@/view/priceManagement/salePolicy";
import AccountManagement from "@/view/rbacManagement/accountManagement";
import RoleManagement from "@/view/rbacManagement/roleManagement";
import SalesmanList from "@/view/rbacManagement/salesmanList";
import CustomerCertificationDetail from "@/view/customerManagement/customerCertification/detail";

// 给路由定义类型接口
export interface RouteOption {
  path: string;
  redirect?: string;
  component?: any;
  privated?: boolean;
  exact?: boolean;
  routes?: RouteOption[];
}

export const routes: RouteOption[] = [
  // 默认布局的页面
  // 需要放在最后面，其他页面放在前面，不然会优先匹配 '/'
  {
    path: "/login",
    component: Login,
    exact: true,
    privated: true
  },
  {
    path: "/notFound",
    component: NotFound,
  },
  {
    path: "/",
    component: AppLayout,
    routes: [
      {
        path: "/",
        component: Dashbord,
        exact: true,
      },
      {
        path: "/commodityCenter/combinationList",
        component: CombinationList,
        exact: true,
      },
      {
        path: "/commodityCenter/commodityList",
        component: CommodityList,
        exact: true,
      },
      {
        path: "/commodityCenter/commodityManagement",
        component: CommodityManagement,
        exact: true,
      },
      {
        path: "/commodityCenter/stockList",
        component: StockList,
        exact: true,
      },
      {
        path: "/customerManagement/customerCertification",
        component: CustomerCertification,
        exact: true,
      },
      {
        path: "/customerManagement/customerCertification/detail",
        component: CustomerCertificationDetail,
        exact: true,
      },
      {
        path: "/customerManagement/distributorList",
        component: DistributorList,
        exact: true,
      },
      {
        path: "/customerManagement/terminalList",
        component: TerminalList,
        exact: true,
      },
      {
        path: "/InventoryManagement/accessManagement",
        component: AccessManagement,
        exact: true,
      },
      {
        path: "/InventoryManagement/warehouseManagement",
        component: WarehouseManagement,
        exact: true,
      },
      {
        path: "/orderManagement/distriminaOrderList",
        component: DistriminaOrderList,
        exact: true,
      },
      {
        path: "/orderManagement/terminalOrderList",
        component: TerminalOrderList,
        exact: true,
      },
      {
        path: "/priceManagement/customerPrice",
        component: CustomerPrice,
        exact: true,
      },
      {
        path: "/priceManagement/originPrice",
        component: OriginPrice,
        exact: true,
      },
      {
        path: "/priceManagement/salePolicy",
        component: SalePolicy,
        exact: true,
      },
      {
        path: "/rbacManagement/accountManagement",
        component: AccountManagement,
        exact: true,
      },
      {
        path: "/rbacManagement/roleManagement",
        component: RoleManagement,
        exact: true,
      },
      {
        path: "/rbacManagement/salesmanList",
        component: SalesmanList,
        exact: true,
      },
    ],
  },

  {
    path: "*",
    redirect: '/notFound',
  },
];
